package jn.chen.utils.poi;

import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * @className: word
 * @author: chenLin
 * @version: 1.0.0
 * @description:
 * @date: 2022/11/1 0001 9:55
 */
public class Word {

    /**
     * 单元测试
     */
    @Test
    public  void getWord(){
        try {
            InputStream is = this.getClass().getClassLoader().getResourceAsStream("word/word.docx");
            XWPFDocument doc = new XWPFDocument(is);
            List<POIXMLDocumentPart> relations = doc.getRelations();
            relations.forEach((t) -> {
                System.out.println(t.toString());
            });
        } catch (IOException e){
         e.printStackTrace();
        }
    }

}
